﻿using System;
using NServiceBus.Management.Messages.EndpointControl;

namespace NServiceBus.Management.EndpointExplorer.Presenter
{               
    public class EndpointExplorerCommandMenuPresenter 
    {
        private readonly IBus bus;
        private readonly EndpointExplorerModel model;
        public SynchronisedObservableCollection<Type> Messages { get; set; }

        public EndpointExplorerCommandMenuPresenter(IBus bus, EndpointExplorerModel model)
        {
            this.bus = bus;
            this.model = model;
            Messages = model.Messages;
        }

        public void PingCommand()
        {
            if (model.SelectedEndpoint != null)
                bus.Send(model.SelectedEndpoint.InputAdress, new PingCommand());
        }

        public void TrackMessage(object parameter)
        {
            
        }
    }
}
